package com.kkd.springcloud.service;

import com.kkd.springcloud.pojo.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author 14587
 * @date 2021/1/18 9:45
 */
@FeignClient(name = "springcloud-provider-dept",fallbackFactory = DeptClientServiceFallbackFactory.class)
public interface DeptClientService {

    @GetMapping("/dept/get/{id}")
    public Dept queryDeptById(@PathVariable("id") Long id);
    @GetMapping("/dept/list")
    public List<Dept> queryDepts();
    @RequestMapping("/dept/add")
    public int addDept(Dept dept);
}
